
package com.hlkj.pay.app.merchant.ext.impl.lakala.dto.resp;
/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

import com.hlkj.framework.common.util.json.JsonUtils;
import lombok.Data;

import java.util.List;

/**
 * @author HlpayTeam
 * @date 2024/12/09 11:36
 */
@Data
public class LakalaAccessQueryRes {

    /**
     * activeNo : activityTime : agencyNo : 0 agentNo : 0 agreementStatus :
     * bizContent : bzPos : channelType : closeTime : contactManName : createTime :
     * customerName : customerNo : 0 customerStatus : externalCustomerNo :
     * identityNo : identityNoExpire : isStandard : legalName : licenseNo : mailbox
     * : mccCode : merLicenseExpire : merName : merchantSource : openTime :
     * optimistic : 0 phoneNo : platform : posSn : position : rewardMode :
     * standardFee : 0 standardTime : termNo : termNum : 0 updateTime : ysfDiscount
     * :
     */

    private CustomerBean customer;

    /**
     * activeNo : activityFlag : openTime : posSn : posType : termNo :
     */

    private PosBean pos;

    /**
     * ableStatus : accountKind : accountName : accountNo : auditStatus : bankName :
     * bankNo : cityCode : cityName : clearingBankNo : countyCode : countyName :
     * createTime : externalCustomerNo : id : 0 idCard : optimistic : 0 ownNo :
     * provinceCode : provinceName : updateTime : validate :
     */

    private SettleCardBean settleCard;

    /**
     * cardType : createTime : customerNo : 0 dayLimit : 0 externalCustomerNo :
     * feeRate : 0 id : 0 maxAmt : 0 minAmt : 0 monthLimit : 0 optimistic : 0
     * perLimi : 0 secondFee : 0 transSettleType : transType : updateTime :
     */

    private List<CustomerFeeBean> customerFee;

    /**
     * cityCode : cityName : provinceCode : provinceName : shopAddress :
     * shopContactMobile : shopContactName : shopDistCode : shopDistName : shopId :
     * 0 shopName :
     */

    private List<ShopInfoListBean> shopInfoList;

    private List<ProductBean> productVos;

    // 外部编号
    private String externalNo;

    /**
     * activeNoVoList :
     * [{"activeNo":"689332038564","busiTypeCode":"BANK_CARD","termNo":"D9332038"},{"activeNo":"689332039182","busiTypeCode":"QR_CODE_CARD","termNo":"D9332039"}]
     * coreTermId : 918903353693360128 termNoList : ["D9332038","D9332039"]
     * termTypeCode : 130 termTypeName : B2B收银台
     */

    private List<TerminalInfoBean> terminalInfo;

    @Data
    public static class CustomerBean {

        private String activeNo;

        private String activityTime;

        private int agencyNo;

        private int agentNo;

        private String agreementStatus;

        private String bizContent;

        private String bzPos;

        private String channelType;

        private String closeTime;

        private String contactManName;

        private String createTime;

        private String customerName;

        private int customerNo;

        private String customerStatus;

        private String auditRemark;

        private String externalCustomerNo;

        private String identityNo;

        private String identityNoExpire;

        private String isStandard;

        private String legalName;

        private String licenseNo;

        private String mailbox;

        private String mccCode;

        private String merLicenseExpire;

        private String merName;

        private String merchantSource;

        private String openTime;

        private int optimistic;

        private String phoneNo;

        private String platform;

        private String posSn;

        private String position;

        private String rewardMode;

        private int standardFee;

        private String standardTime;

        private String termNo;

        private int termNum;

        private String updateTime;

        private String ysfDiscount;
    }

    @Data
    public static class PosBean {

        private String activeNo;

        private String activityFlag;

        private String openTime;

        private String posSn;

        private String posType;

        private String termNo;
    }

    @Data
    public static class SettleCardBean {

        private String ableStatus;

        private String accountKind;

        private String accountName;

        private String accountNo;

        private String auditStatus;

        private String bankName;

        private String bankNo;

        private String cityCode;

        private String cityName;

        private String clearingBankNo;

        private String countyCode;

        private String countyName;

        private String createTime;

        private String externalCustomerNo;

        private int id;

        private String idCard;

        private int optimistic;

        private String ownNo;

        private String provinceCode;

        private String provinceName;

        private String updateTime;

        private String validate;
    }

    @Data
    public static class CustomerFeeBean {

        private String cardType;

        private String createTime;

        private int customerNo;

        private int dayLimit;

        private String externalCustomerNo;

        private int feeRate;

        private int id;

        private int maxAmt;

        private int minAmt;

        private int monthLimit;

        private int optimistic;

        private int perLimi;

        private int secondFee;

        private String transSettleType;

        private String transType;

        private String updateTime;

    }

    @Data
    public static class ShopInfoListBean {

        private String cityCode;

        private String cityName;

        private String provinceCode;

        private String provinceName;

        private String shopAddress;

        private String shopContactMobile;

        private String shopContactName;

        private String shopDistCode;

        private String shopDistName;

        private int shopId;

        private String shopName;

    }

    @Data
    public static class ProductBean {

        private String product;

        private String productName;

    }

    public static void main(String[] args) {
        String response = "{\"customer\":{\"activityType\":\"20231030LSYZSZC_WECHAT_PAY\",\"activityTypeName\":\"20231030拉生意真商政策\",\"agencyNo\":30000081,\"agentNo\":20000101,\"agreementStatus\":\"TRUE\",\"auditRemark\":\"该商户主体与开展业务不匹配\",\"bzPos\":\"B2B_SYT\",\"channelType\":\"TP_MERCHANT\",\"cityName\":\"武汉市\",\"contactManName\":\"汤**\",\"countyName\":\"洪山区\",\"createTime\":1733471531000,\"customerName\":\"湖北汇联物联科技有限公司\",\"customerNo\":100133243,\"customerStatus\":\"REJECT\",\"identityNo\":\"420921********3416\",\"identityNoExpire\":\"2039-01-29\",\"identityNoStDt\":\"2019-01-29\",\"isStandard\":\"FALSE\",\"legalName\":\"汤**\",\"licenseNo\":\"91420100MADRQ3P129\",\"mailbox\":\"111\",\"mccCode\":\"4733\",\"merLicenseExpire\":\"2999-12-31\",\"merLicenseStDt\":\"2024-07-22\",\"merName\":\"湖北汇联物联科技有限公司\",\"merRegName\":\"湖北汇联物联科技有限公司\",\"merchantSource\":\"H5\",\"optimistic\":6,\"phoneNo\":\"180******61\",\"phoneNoEnc\":\"Heg6Hh9Xz35YZADP3vy6Fw==\",\"phoneNoHash\":\"a375eb08333f4c83c770e09e10554b1b\",\"platform\":\"LKL\",\"posSn\":\"\",\"provinceName\":\"湖北省\",\"receiveDetail\":\"湖北省武汉市高新大道100号\",\"rewardMode\":\"TO_AGENT\",\"standardFee\":0.0,\"termNum\":1,\"updateTime\":1733471538000,\"ysfDiscount\":\"FALSE\"},\"customerFee\":[{\"cardApplicationId\":13739690,\"cardType\":\"WECHAT\",\"createTime\":1733471532000,\"customerManagementFee\":0.0,\"customerManagementdFee\":0.0,\"customerManagementeFee\":0.0,\"customerManagementfFee\":0.0,\"customerNo\":100133243,\"dayLimit\":10000.0,\"feeRate\":2.0E-4,\"id\":113778397,\"maxAmt\":9999.0,\"minAmt\":0.1,\"monthLimit\":200000.0,\"optimistic\":0,\"perLimi\":5000.0,\"settlementType\":\"AUTOMATIC\",\"termId\":11231844,\"transSettleType\":\"D1\",\"transType\":\"SCAN\"},{\"cardApplicationId\":13739690,\"cardType\":\"ALIPAY\",\"createTime\":1733471532000,\"customerManagementFee\":0.0,\"customerManagementdFee\":0.0,\"customerManagementeFee\":0.0,\"customerManagementfFee\":0.0,\"customerNo\":100133243,\"dayLimit\":10000.0,\"feeRate\":2.0E-4,\"id\":113778398,\"maxAmt\":9999.0,\"minAmt\":0.1,\"monthLimit\":200000.0,\"optimistic\":0,\"perLimi\":5000.0,\"settlementType\":\"AUTOMATIC\",\"termId\":11231844,\"transSettleType\":\"D1\",\"transType\":\"SCAN\"},{\"cardApplicationId\":13739690,\"cardType\":\"UNIONPAY_WALLET_DEBIT_FEE\",\"createTime\":1733471532000,\"customerManagementFee\":0.0,\"customerManagementdFee\":0.0,\"customerManagementeFee\":0.0,\"customerManagementfFee\":0.0,\"customerNo\":100133243,\"dayLimit\":10000.0,\"feeRate\":2.0E-4,\"id\":113778399,\"maxAmt\":0.02,\"minAmt\":0.1,\"monthLimit\":200000.0,\"optimistic\":0,\"perLimi\":5000.0,\"settlementType\":\"AUTOMATIC\",\"termId\":11231844,\"transSettleType\":\"D1\",\"transType\":\"SCAN\"}],\"productVos\":[],\"settleCard\":{\"ableStatus\":\"ENABLE\",\"accountKind\":\"58\",\"accountName\":\"汤**\",\"accountNo\":\"1508****0007\",\"auditStatus\":\"SUCCESS\",\"bankName\":\"平安银行股份有限公司武汉光谷科技支行\",\"bankNo\":\"306\",\"cityCode\":\"5210\",\"cityName\":\"武汉市\",\"clearingBankNo\":\"307521005874\",\"createTime\":1733471532000,\"id\":27318,\"idCard\":\"4****************6\",\"isLegalPerson\":true,\"optimistic\":0,\"ownNo\":\"100133243\",\"provinceCode\":\"5200\",\"provinceName\":\"湖北省\"},\"terminalInfo\":[{\"termTypeCode\":130,\"termTypeName\":\"B2B收银台\"}]}";
        LakalaAccessQueryRes lakalaAccessRes = JsonUtils.parseObject(response, LakalaAccessQueryRes.class);
        System.out.println(JsonUtils.toJsonString(lakalaAccessRes));
    }

    @Data
    public static class TerminalInfoBean {

        private long coreTermId;

        private int termTypeCode;

        private String termTypeName;

        /**
         * activeNo : 689332038564 busiTypeCode : BANK_CARD termNo : D9332038
         */

        private List<ActiveNoVoListBean> activeNoVoList;

        private List<String> termNoList;

        @Data
        public static class ActiveNoVoListBean {

            private String activeNo;

            private String busiTypeCode;

            private String termNo;

        }
    }
}
